package com.cloud.feign.test.config;

import com.cloud.common.Swagger.SwaggerConfigBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableSwagger2
@Configuration
public class SwaggerConfig {
    @Value("${swagger.enable}")
    private Boolean enable;
    /**
     * swagger
     * @return
     */
    @Bean
    public Docket createRestApi() {
        SwaggerConfigBuilder builder = SwaggerConfigBuilder.createBuilder("com.cloud.feign.test.controller","hello api", "FeignController API", "1.0.0",enable);
        return builder.addParameterBuilder("departmentRoleId","角色id")
                .addParameterBuilder("token","token")
                .addContact("lwj","https://www.baidu.com/","934256@qq.com")
                .build();
    }

}
